Skip to content

Quote paths in editable installs#551

Open
aryasadeghi1 wants to merge 3 commits into
Azure:devfrom
aryasadeghi1:fix/550-quote-editable-install-paths
Open

Quote paths in editable installs#551
aryasadeghi1 wants to merge 3 commits into
Azure:devfrom
aryasadeghi1:fix/550-quote-editable-install-paths

Conversation

@aryasadeghi1

Copy link
Copy Markdown
Member

Fix: editable installs and pytest runner fail on paths with spaces (#550, #415)

Problem

Paths containing spaces (common with OneDrive) broke commands because the path was
interpolated unquoted into the command string:

Fix

  • Added a platform-aware quote_arg helper in azdev/utilities/command.py
    • Windows: subprocess.list2cmdline (string passed verbatim to CreateProcess)
    • POSIX: shlex.quote (matches the shlex.split done by the runners)
  • Applied it at all editable-install call sites in extensions/__init__.py,
    setup.py, and code_gen.py, plus testtool/pytest_runner.py.

Tests

  • New test_editable_install_quoting.py covers whitespace paths on Windows + POSIX
    and verifies add_extension emits a quoted path.

Closes #550, closes #415.

)

Paths containing spaces (e.g. OneDrive folders) broke 'pip install -e <path>' and the pytest runner because the path was interpolated unquoted into the command string. Add a platform-aware quote_arg helper (subprocess.list2cmdline on Windows, shlex.quote on POSIX) and apply it at all editable-install call sites and the pytest runner. Adds regression tests covering whitespace paths.
@aryasadeghi1 aryasadeghi1 self-assigned this Jun 8, 2026
@aryasadeghi1 aryasadeghi1 requested a review from necusjz June 8, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azdev editable installs fail on paths with spaces (unquoted pip install -e <path>) Arguments are not quoted when calling pytest

1 participant